#include <buola/image/format.h>
#include <buola/image/io.h>
#include <buola/image/drawing/basic.h>
#include <buola/image/adaptors.h>

using namespace buola;

int main()
{
    img::CImage_rgb8 lImage({320,200},img::pixel(50,50,50));

    img::CPixel_rgb8 lSpan[320];

    for(int i=0;i<lImage.Width();i++)
    {
        lSpan[i]=img::CColor(img::nWaveLength,380.0+400.0*i/lImage.Width(),0.8);
    }
    
    start_timer();
    for(int j=0;j<100;j++)
    for(int i=0;i<lImage.Height();i++)
    {
        img::fill_hspan(lImage,0,i,lImage.Width(),lSpan);
    }
    end_timer();

    img::save(lImage,io::file("agg3.ppm"));
}